test(signals): cover decidePublicSurface's oss_maintainer + not_checked willLabel fallback (#8324) - #8485
Conversation
…ed willLabel fallback (JSONbored#8324) The inline fallback disjunct in willLabel's computation (settings.publicAudienceMode === "oss_maintainer" && input.minerStatus === "not_checked" && settings.autoLabelEnabled && (comment_and_label || label_only)) had zero test coverage despite decidePublicSurface's own doc comment claiming it's the single source of truth shared by the live webhook processor and the maintainer-facing dry-run preview. Adds four tests covering every combination of autoLabelEnabled and publicSurface for this branch: labels for comment_and_label and label_only, does not label for comment_only or when autoLabelEnabled is false. shouldApplyPrLabel itself always returns false for oss_maintainer + any non-confirmed status, so willLabel: true in these tests is exclusively exercising the inline fallback, not double-satisfied by the imported function. Pure test-addition, no production code changed.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-24 15:27:32 UTC
Review summary Nits — 4 non-blocking
CI checks failing
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests-merge)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Summary
decidePublicSurface'swillLabelcomputation (src/signals/settings-preview.ts:147-149) has an inline fallback disjunct forpublicAudienceMode: "oss_maintainer"+minerStatus: "not_checked"that had zero test coverage —grep -n "not_checked" test/unit/settings-preview.test.tsreturned no matches before this PR.autoLabelEnabledandpublicSurfacefor this branch: labels whencomment_and_labelorlabel_onlywithautoLabelEnabled: true, does NOT label forcomment_only(excluded by the disjunct's ownpublicSurfacecheck) or whenautoLabelEnabled: false.shouldApplyPrLabelitself always returnsfalsefoross_maintainer+ any non-"confirmed"status (including"not_checked"), confirmed by reading its source — sowillLabel: truein these new tests is exercising exclusively the inline fallback disjunct, not double-satisfied by the imported function. Pure test-addition; no production code insettings-preview.tswas changed, per the issue's explicit scope.Closes #8324
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
test/unit/settings-preview.test.ts(test-only, nosrc/production-code change) — no UI/MCP/workers/OpenAPI surface is affected. Verified vianpx vitest run test/unit/settings-preview.test.ts: all 36 tests pass, including the 4 new ones. Coverage on the changed condition (verified directly againstcoverage/lcov.info): thewillLabelcomputation's line shows all 6 tracked branch points hit (BRDA:148,21,0,37throughBRDA:148,21,5,2— every count non-zero), confirming full branch coverage across the whole||/&&chain including the previously-uncoverednot_checkedfallback.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots. (N/A — no visible UI changes.)Notes
shouldApplyPrLabel's intent was found while writing these tests — the fallback disjunct behaves exactly as its own inline logic states, so there's nothing to flag for maintainer triage beyond the new coverage itself.